package com.example.demo.controller;

import com.example.demo.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.ArrayList;
import java.util.List;

@Controller
public class UserController {
    @GetMapping("/look")
    public String userList(Model model){
        List<User> list=new ArrayList<>();
        list.add(new User(1,"张三"));
        list.add(new User(2,"李四"));
        list.add(new User(3,"王五"));
        list.add(new User(4,"赵四"));
        model.addAttribute("list",list);
        return "list";

    }
}
